Manipulate[

checkfcn=TrueQ[f[x]===Log[1+x]];
If[checkfcn&&(xpt≤-1),xpt=-0.9999];
If[checkfcn&&(errx≤-1||xpt≤-1),xpt=-0.9999];
If[errx<-xmax,errx=-xmax];
If[errx>xmax,errx=xmax];
If[xpt<-xmax,xpt=-xmax];
If[xpt>xmax,xpt=xmax];
Switch[opts,1,showpoly=True;showerror=False,2,showpoly=False;showerror=True,3,showpoly=False;showerror=False];

graphlist=Evaluate@Intersection[Table[Normal[Series[f[x],{x,xpt,n}]],{n,0,terms}]];
T=Function[{x},Evaluate@Normal[Series[f[x],{x,xpt,terms}]]];

Pane[
Column[{
Column[{
Row[{Text@Style[Row[{Style["f",Italic],"(",Style["x",Italic],") = ",ToString[f[x],TraditionalForm]}],20,Red]
}],

Dynamic@Item[Show[maingraph=Plot[f[x],{x,-xmax,xmax},PlotStyle->Red,PlotRange->{{-xmax,xmax},{-ymax,ymax}}],
If[showall,Plot[graphlist,{x,-xmax,xmax},PlotRange->{{-xmax,xmax},{-ymax,ymax}}],{}],
Plot[Last[graphlist],{x,-xmax,xmax},PlotRange->{{-xmax,xmax},{-ymax,ymax}},PlotStyle->Black],
Graphics[{
If[showerror,{Darker[Green,0.3],
{{PointSize[0.02],Point[{errx,T[errx]}]},
{PointSize[0.02],Point[{errx,f[errx]}]},
{Line[{{errx,T[errx]},{errx,f[errx]}}]}
}},{}],
{Purple,PointSize[0.02],Point[{xpt,f[xpt]}]}
}],
ImageSize->{450,250},PlotRange->{{-xmax,xmax},{-ymax,ymax}},ImagePadding->20,AspectRatio->250/450],
ItemSize->{Automatic,25}],

Item[If[showerror,
Column[{
Dynamic@Text@Style[Column[{
Row[{Style["f",Italic],"(",errx,") = ",TraditionalForm@f[errx]}],
Row[{Subscript[Style["T",Italic],terms],"(",errx,") = ",T[errx]}],
Row[{"error = ",TraditionalForm[f[errx]-T[errx]]}],
Style[Row[{"|error| = ",N@Abs[f[errx]-T[errx]]}],16,Bold]
}],14,Darker[Green,0.5]],
If[showerror,Row[{Style["error point ","Label",10],If[checkfcn,Control[{{errx,0},-0.9999,xmax}],Control[{{errx,0},-xmax,xmax}]]}],""]}],
If[showpoly,
Pane[Text@Style[Row[{Subscript[Style["T",Italic],terms],"(",Style["x",Italic],") = ",Normal[Series[f[x],{x,xpt,terms}]]/.x->Style["x",Italic]}],12],400],""]],ItemSize->{Automatic,11}]

},Alignment->Top]
}],
{525,405},Alignment->Center],

Row[{Grid[{{Pane[Grid[{
{"expansion point",
PaneSelector[
{True->Control[{{xpt,0},-0.9999,xmax,Appearance->"Labeled",ImageSize->Tiny}],
False->Control[{{xpt,0},-xmax,xmax,Appearance->"Labeled",ImageSize->Tiny}]},
Dynamic[checkfcn]
]},
{"terms (highest degree)",Control[{{terms,2},0,10,1,Appearance->"Labeled",ImageSize->Tiny}]},
{"x axis",Control[{{xmax,10},1.01,20,Appearance->"Labeled",ImageSize->Tiny}]}

},Alignment->{{Right,Left},Center}],300],
Column[{
Row[{"f(x) = ",PopupMenu[Dynamic[f],Map[MapAt[TraditionalForm,#,2]&,
{Cos->Cos[x],Sin->Sin[x],Tan->Tan[x],Exp->Exp[x],ArcTan->ArcTan[x] ,Log[#]&->Log[x],Log[1+#]&->Log[1+x],
1/(#+1)&->1/(x+1),1/(1-#)&->1/(1-x)}]]}],
Row[{"graph all polynomials ",Control[{{showall,True},{True,False}}]}],
Row[{"show ",Control[{{opts,1},{1->" polynomial  ",2->" error  ",3->"  neither"},ControlType->RadioButtonBar}]}]
}]
}},Dividers->{{False,Gray,False},None},Spacings->{1,Automatic}]}],

{{f,Cos,"f(x) ="},Map[MapAt[TraditionalForm,#,2]&,
{Cos->Cos[x],Sin->Sin[x],Tan->Tan[x],Exp->Exp[x],ArcTan->ArcTan[x],Log[#]&->Log[x],Log[1+#]&->Log[1+x],1/(#+1)&->1/(x+1),1/(1-#)&->1/(1-x)}],None},
{{ymax,3,"y axis"},1,20,VerticalSlider,ControlPlacement->Left},
{{graphlist,{1}},ControlType->None},
{{T,Function[{x},1]},ControlType->None},
{{checkfcn,False},ControlType->None},
AutorunSequencing->{1,5,6},TrackedSymbols->True
]